#include "arduino/WProgram.h"
#include "Command.h"
#include "Protocol.h"
#include "Commands.h"

int main(void)
{
	init(); // arduino's code, without this, things don't work (like delay(), millis())
	// Turn everything off
	for(int i = 0; i < 14; i++)
		digitalWrite(i, LOW);
	interrupts();

	SetupCommandArray(); //without this, all ReadCommand()s return NULL

	Serial.begin(57600);
    
	while(1)
	{
		//loop
		if(Serial.available() > 3)
		{
			ReadCommand();
		}

		if(GetRequestToStream())
			Stream();
	}
        
	return 0;
}

